/**
 * Author 12629
 * @Date 2022/4/15 14:15
 * @Description:
 */


public class TestDemo {
    public static void main(String[] args) {
        System.out.println(10%-3);
        System.out.println(-10%3);
        System.out.println(-10%-3);
    }
    public static void main14(String[] args) {
        String str = "123";
        int a =Integer.valueOf(str);
        System.out.println(a+1);//把字符串变整数
        int b = Integer.parseInt(str);
        System.out.println(b);//搜索 相关软件  jdk---CHM  索引
    }


    public static void main13(String[] args) {
        int num = 10;
        String str1 = num+"";
        System.out.println(str1);//输出一零   10  String是字符串
        String str2 = String.valueOf(num);//把整数变字符串

    }


    public static void main12(String[] args) {
        String str = "zhangweizhen";
        //System.out.println(str);
        String str2 = "很帅！";
        System.out.println(str+str2);//拼接
        //Java并不简单
        int a = 10;
        int b = 20;
        System.out.println("a = "+a+" b = "+b); //a = 10 b = 20
        System.out.println("a+b = "+a+b);// a+b = 1020
        System.out.println("a+b = "+(a+b));// a+b = 30
        System.out.println(a+b+"<- a+b");
    }


    public static void main11(String[] args) {
        byte b1 = 10;
        byte b2 = 20;
        byte b3 = (byte) (b1+b2);//所有小于四个字节的元素 都会提升为四个字节
        System.out.println(b3);
    }
    public static void main10(String[] args) {
        int a = 10;
        long b =10L;
        //a = b;   大的不能转小的long 范围大于int
        //强制转换  a = (int)b
        //  flot f =3.14F;
        //   double d =5.12;
        //   强制转化  f = (float)d;  统称显示转换  但是可能丢失精度
        b = a;

    }


    public static void main9(String[] args) {
        //java中  boolean只能取两个值  要么是true要么是false
        //没有所谓的0是假非0是真
        //if的条件语句必须是布尔表达式
        boolean flg = true;
        System.out.println(flg);

    }


    public static void main8(String[] args) {
        char ch = 'a';//字符型数据类型   2字节  一个中文2个字节
        System.out.println(ch);
        //String s = "高博"
        //char ch2 ==100;  char可以赋值整数，但不可以赋值复数
        // 加中文就要用-encoding UTF-8 Test.java
        //即  javac -encoding UTF-8 Test.java
    }

    public static void main7(String[] args) {
        double d = 19.9;//8字节
        System.out.println(d);
    }
    public static void main6(String[] args) {
        float f = 12.5f;//4字节  遵循C语言讲的float的存储
        System.out.println(f);
        System.out.println(Float.MAX_VALUE);
        System.out.println(Float.MIN_VALUE);

    }


    public static void main5(String[] args) {
        byte b1 = 18;//1字节
        System.out.println(b1);
        System.out.println(Byte.MAX_VALUE);
        System.out.println(Byte.MIN_VALUE);
    }

    public static void main4(String[] args) {
        //2个字节   -2^15 ~ (2^15))-1
        short sh = 10;
        System.out.println(sh);
        System.out.println(Short.MAX_VALUE);
        System.out.println(Short.MIN_VALUE);
    }

    public static void main3(String[] args) {
        long a =10L;//8字节
        System.out.println(a);
        System.out.println(Long.MAX_VALUE);
        System.out.println(Long.MIN_VALUE);
    }


    public static void main2(String[] args) {
        int a = 10;//4字节
        System.out.println(a);
        System.out.println(Integer.MAX_VALUE);
        System.out.println(Integer.MIN_VALUE);

        int ret = Integer.valueOf("123");
        System.out.println(ret);

    }
    public static void main1(String[] args) {
        //1. psvm[main]  2.sout
        System.out.println("hello");
        int a = 10;//4字节
        boolean flg = true;
        System.out.println(flg);
    }
}

